<admintpl file="header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a >充值记录</a></li>

		</ul>
		<form class="well form-search" name="form1" method="post" style="float:left" action="">
            <if condition="$showlevel eq 0">
            代理商：
			<select class="select_2" name="proxyid" id="proxyid">
				<option value="">全部</option>
			</select>
            </if>
            <if condition="$showlevel lt 2">
            业务员：
			<select class="select_2" name="promoterid" id="promoterid">
				<option value="">全部</option>
                <volist name="promoterlist" id="v">
				<option value="{$v['id']}" <if condition="$formget.promoterid eq $v['id']">selected</if> >{$v['user_nicename']}</option>
                </volist>	
			</select>
            </if>
            订单状态：
			<select class="select_2" name="status">
				<option value="">全部</option>
				<option value="1" <if condition="$formget.status eq '1'">selected</if> >已完成</option>
				<option value="0" <if condition="$formget.status eq '0'">selected</if> >未支付</option>			
			</select>
			提交时间：
			<input type="text" name="start_time" class="js-date date" id="start_time" value="{$formget.start_time}" style="width: 80px;" autocomplete="off">-
			<input type="text" class="js-date date" name="end_time" id="end_time" value="{$formget.end_time}" style="width: 80px;" autocomplete="off"> &nbsp; &nbsp;
			关键字： 
			<input type="text" name="keyword" style="width: 200px;" value="{$formget.keyword}" placeholder="请输入会员id、订单号...">
			<input type="button" class="btn btn-primary" value="搜索" onclick="form1.action='{:U('Charge/index')}';form1.submit();"/>
			<input type="button" class="btn btn-primary" style="background-color: #1dccaa;" value="导出" onclick="form1.action='{:U('Charge/export')}';form1.submit();"/>
			<div style="margin-top:10px">
				人民币金额统计：{$moneysum|default=0} 元 (根据筛选条件统计)
			</div>		
		</form>	
    	
		<form method="post" class="js-ajax-form" >

		
			<table class="table table-hover table-bordered">
				<thead>
					<tr>
						<th align="center">ID</th>
						<th>会员</th>
						<th>人民币金额</th>
						<th>兑换{$configpub['name_coin']}</th>
						<th>赠送{$configpub['name_coin']}</th>
						<th>商户订单号</th>
						<th>支付类型</th>
						<th>支付环境</th>
						<th>第三方支付订单号</th>
						<th>订单状态</th>
						<th>提交时间</th>

						<!-- <th align="center">{:L('ACTIONS')}</th> -->
					</tr>
				</thead>
				<tbody>
					<php>
                        $status=array("0"=>"未支付","1"=>"已完成");
                        $type=array("1"=>"支付宝","2"=>"微信","3"=>"苹果支付");
                        $ambient=array(
                            "1"=>array(
                                '0'=>'App',
                                '1'=>'PC',
                            ),
                            "2"=>array(
                                '0'=>'App',
                                '1'=>'公众号',
                                '2'=>'PC',
                            ),
                            "3"=>array(
                                '0'=>'沙盒',
                                '1'=>'生产',
                            )
                        );
                    </php>
					<foreach name="lists" item="vo">
					<tr>
						<td align="center">{$vo.id}</td>
						<td>{$vo['userinfo']['user_nicename']} ( {$vo['uid']} )</td>	
						<td>{$vo['money']}</td>
						<td>{$vo['coin']}</td>
						<td>{$vo['coin_give']}</td>
						<td>{$vo['orderno']}</td>
						<td>{$type[$vo['type']]}</td>
						<td>{$ambient[$vo['type']][$vo['ambient']]}</td>
						<td>{$vo['trade_no']}</td>
						<td>{$status[$vo['status']]}</td>
						<td>{$vo.addtime|date="Y-m-d H:i:s",###}</td>
						<!-- <td align="center">	 -->
 							<!-- <a href="{:U('Gift/edit',array('id'=>$vo['id']))}" >编辑</a> | -->
							<!-- <a href="{:U('Charge/del',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="您确定要删除吗？">删除</a> 
						</td> -->
					</tr>
					</foreach>
				</tbody>
			</table>
			<div class="pagination">{$page}</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
    <script>
        var list='{$proxylistj}';
        var proxyid='{$formget['proxyid']}';
        var promoterid='{$formget['promoterid']}';
        var lists='';
        if(list){
            lists=typeof(list)=='object'?list:JSON.parse(list);
        }
        
        
        function cteateProxyid(){
            if(!lists){
                return !1;
            }
            var proxy_html='<option value="">全部</option>';
            for(var k in lists){
                var v=lists[k];
                if(k==proxyid){
                    proxy_html+='<option value="'+v.id+'" selected>'+v.user_nicename+'</option>';
                }else{
                    proxy_html+='<option value="'+v.id+'">'+v.user_nicename+'</option>';
                }
            }
            
            $("#proxyid").html(proxy_html);
            if(proxyid){
                cteatePromoterid();
            }
        }
        
        function cteatePromoterid(){
            if(!lists){
                return !1;
            }
            var promoter_html='<option value="">全部</option>';
            
            if(proxyid){
            var list2=lists[proxyid]['list'];

                for(var k in list2){
                    var v=list2[k];
                    if(k==promoterid){
                        promoter_html+='<option value="'+v.id+'" selected>'+v.user_nicename+'</option>';
                    }else{
                        promoter_html+='<option value="'+v.id+'">'+v.user_nicename+'</option>';
                    }
                    
                }
            }
            $("#promoterid").html(promoter_html);
        }

        cteateProxyid();

        $("#proxyid").change(function(){
            proxyid=$(this).val();
            cteatePromoterid();
        })
        
    </script>
</body>
</html>